#include<stdio.h>
#include<string.h> 
struct Candidate{
	char name[10];
	unsigned int count;
};
int main()
{
	struct Candidate vote[4]={
		{.name = "ZS",0},
	 	{.name = "LS",0},
	 	{.name = "WW",0},
		{.name = "QQ",0}
	};
	int num,i;
	char nAme[999][999];
	scanf("%d",&num);
	if(num<=3||num>100)
	  	printf("Input Error\n");
	else //if(num>3&&num<=100)
	{
		for(i=0;i<num;i++)
		{
			scanf("%s",nAme[i]);
			for(int j=0;j<num;j++)
			{
				if(strcmp(nAme[i],vote[j].name)==0)
					(vote[j].count)++;
			}
			vote[3].count = num - (vote[0].count+vote[1].count+vote[2].count);
		}
		printf("ZS:%d\nLS:%d\nWW:%d\nQQ:%d\n",vote[0].count,vote[1].count,
											  vote[2].count,vote[3].count);
	}
	return 0;
}
